package com.adu.retrofixtest.service;

import com.adu.retrofixtest.domain.ParamEntity;
import com.adu.retrofixtest.domain.Result;
import retrofit2.Call;
import retrofit2.http.*;

public interface RequestService {
    //http://localhost:8089/findList
    @GET("/findList")
    Call<Result> findList();

    //http://localhost:8089/findById/9
    //请求示例：@GetMapping("/findById/{id}")
    //public  Map<String,Object> testparam(@PathVariable("id") String id){}
    @GET("/findById/{id}")
    Call<Result> findById(@Path("id") Integer id);


    //http://localhost:8089/findByName?name=duzhenwen
    //请求示例：@GetMapping("/findByName")
    //public  Map<String,Object> testparam(@RequestParam("name") String name) {}
    @GET("/findByName")
    Call<Result> findByName(@Query("name") String name);

    //http://localhost:8089/save
    //@PostMapping("/save")
    //public Map<String,Object> save(@RequestBody Domain domain){}
    @POST("/save")
    Call<Result> save(@Body ParamEntity param);

}
